<template>
	<view class="swp">
		<swiper indicator-dots="true" indicator-active-color="#d44439" autoplay="true" circular="true">
			<swiper-item v-for="item in swipers" :key="item.bannerId">
				<!--  #ifdef  MP-WEIXIN -->
				<image :src="item.pic"></image>
				<!--  #endif -->
				<!--  #ifndef  MP-WEIXIN -->
				<img  v-lazy="item.pic">
				<!--  #endif -->
			</swiper-item>
		</swiper>
	</view>
</template>

<script>
	import {banner} from '../../api/tuijian/tuijian.js'
	export default {
		created() {
			this.getswiper()
		},
		data() {
			return {
				swipers:[]
			};
		},
		methods:{
			getswiper(){
				banner({type:1}).then(res => {
					console.log(res)
					this.swipers = res.banners
				})
			}
		}
	}
</script>

<style lang="scss">
.swp{
	margin-top: 20rpx;
	// background-color: $red;
	width: 100%;
	/*  #ifdef  MP-WEIXIN */
	image{
		width: 100%;
		height: 100%;
	}
	/*  #endif  */
	/*  #ifndef  MP-WEIXIN */
	img{
		width: 100%;
		height: 100%;
	}
	/*  #endif  */
}
</style>
